#ifdef __cplusplus
extern "C"{
#endif

#include "xs_or.h"

tyint xs_or(tyint val_a, tyint val_b)
{
    tyint val_c = 0, i = 0;

    for(i = 0; i < sizeof(tyint) * 8; i++){
        if((val_a >> i)&0x01){
            if((val_b >> i) & 0x01)
                val_c &= ~(1 << i);
            else val_c |= (1 << i);
        }
        else{
            if((val_b >> i) & 0x01)
                val_c |= (1 << i);
            else val_c &= ~(1 << i);
        }
    }
    return val_c;
}

#ifdef __cplusplus
}
#endif
